package eerbaar.v2.gamebuilder.client;

import java.awt.Graphics2D;

import eerbaar.v2.app.tasks.IGameTask;
import eerbaar.v2.gamebuilder.client.request.Requester;

public class CheckRequesterTask implements IGameTask {

    public CheckRequesterTask() {
        //
    }

    @Override
    public void doTask(Graphics2D g) {

        if (Requester.getInstance().needsProcessing()) {
            Requester.getInstance().processInGameLoop();
        }
    }

    @Override
    public Priority getPriority() {
        return Priority.FIRST;
    }

    @Override
    public int getRate() {
        return IGameTask.STANDARD_RATE;
    }

    @Override
    public boolean runWhenSuspended() {
        return true;
    }

}
